package xcmg.device.dao.mapper.agent;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import xcmg.device.dao.entity.agent.ServiceBorrowInDetailDO;
import xcmg.device.service.vo.agent.ServiceBorrowInDetailVO;
import org.apache.ibatis.annotations.Mapper;
import yb.ecp.fast.infra.infra.PageCommonVO;
import yb.ecp.fast.infra.infra.SearchCommonVO;

import java.math.BigDecimal;
import java.util.List;


/**
 * 服务退回单明细 Mapper
 * @author huhuawei
 */
@Mapper
@Repository
public interface ServiceBorrowInDetailMapper {

    PageCommonVO list(SearchCommonVO<ServiceBorrowInDetailVO> condition);

    List<ServiceBorrowInDetailDO> queryList(ServiceBorrowInDetailVO condition);

    int insert(ServiceBorrowInDetailDO model);

    int merge(ServiceBorrowInDetailDO model);

    int updateByPrimaryKeySelective(ServiceBorrowInDetailDO bean);

    int deleteByPrimaryKeySelective(String id);

    BigDecimal queryThisReturnQty(@Param("borrowOutDetailId")String borrowOutDetailId,@Param("materialsNo")String materialsNo);

    List<ServiceBorrowInDetailDO> queryByBorrowInId(@Param("borrowInId")String borrowInId);

    int deleteByBorrowInId(@Param("borrowInId")String borrowInId);

    //获取已创建退回单的数量
    BigDecimal queryCreateBorrowInQty(@Param("borrowOutDetailId")String borrowOutDetailId,@Param("materialsNo")String materialsNo);

    int updateStatus(@Param("status") Integer status, @Param("billId") String billId, @Param("materialsNo") String materialsNo);

    ServiceBorrowInDetailDO item(@Param("borrowInId") String borrowInId, @Param("materialsNo") String materialsNo);

    ServiceBorrowInDetailDO selectByPrimaryKey(@Param("id") String id);

    int getCount(@Param("borrowInId") String borrowInId);
}
